<?php

namespace Modules\DataCheck\Enums;

use Modules\DataCheck\Enums\Tratis\EnumExtend;

enum TaskStateEnum: int implements Enum
{
    use EnumExtend;

    //任务状态 1=待核对 2=等待核对中 3=核对中 4=核对完成 5=核对失败 6=停止核对 61=任务停止中
    case WAIT = 1;
    case WAIT_RUNNING = 2;
    case RUNNING = 3;
    case COMPLETE = 4;
    case FAILED = 5;
    case STOP = 6;
    case TASK_STOPING = 61;
    case STOP_CHECK_COMPLETE = 64;
    case STOP_CHECK_FAILED = 65;

    /**
     * @return string
     */
    public function message(): string
    {
        return match ($this) {
            self::WAIT => '待核对',
            self::WAIT_RUNNING => '等待任务排队中',
            self::RUNNING => '核对中',
            self::COMPLETE => '核对完成',
            self::FAILED => '核对失败',
            self::STOP => '核对已停止',
            self::TASK_STOPING => '任务停止中',
            self::STOP_CHECK_COMPLETE => '核对已停止(核对完成)',
            self::STOP_CHECK_FAILED => '核对已停止(核对失败)',
            default => '',
        };
    }
}